<div id="screansBlock">
    <div id="block">
        <div id="leftBlock">
            <?foreach ($allImages[$mainBlock['id']] as $key=>$value):?>
                <img src="<?=$value['imgPath'];?>" 
                     title="<?=$value['name'];?>" />
            <?endforeach;?>
        </div>
        <div id="centrBlock">
            <?for ($i=0; $i<=2; $i++):?>
                <?if (isset($allImages[$centrBlock['id']][$i]['imgPath'])):?>
                    <div class="centrBlocks">
                        <a href="#" title="<?=(isset($allImages[$centrBlock['id']][$i]['name'])) ? $allImages[$centrBlock['id']][$i]['name'] : '';?>">
                            <img src="<?=(isset($allImages[$centrBlock['id']][$i]['imgPath'])) ? $allImages[$centrBlock['id']][$i]['imgPath'] : '';?>"
                                  title="<?=(isset($allImages[$centrBlock['id']][$i]['name'])) ? $allImages[$centrBlock['id']][$i]['name'] : '';?>" />
                            <div class="bottomBlock">
                                <span class="blueMessege"><?=(isset($allImages[$centrBlock['id']][$i]['name'])) ? $allImages[$centrBlock['id']][$i]['name'] : '';?></span>
                                <div class="rightArrow"></div>
                            </div>
                        </a>
                    </div>
                <?endif;?>
            <?endfor;?>
        </div>
    </div>
    <div id="rightBlock">
        <?for ($i=0; $i<=1; $i++):?>
            <?if (isset($allImages[$rightBlock['id']][$i]['imgPath'])):?>
                <div class="rightBlocks">
                    <a href="#">
                        <img src="<?=(isset($allImages[$rightBlock['id']][$i]['imgPath'])) ? $allImages[$rightBlock['id']][$i]['imgPath'] : '';?>" style="height: 100%"/>
                    </a>
                </div>
            <?endif;?>
        <?endfor;?>
    </div>
</div>
<?=$bottomblock;?>
<?=$downblock;?>